<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
</head>
<body>
<button id="btn2">js调用java</button><br><br>
<button id="btn3">js调用java</button><br><br>
<button id="btn4">js调用java</button>
<button id="btn5">js调用java</button>
<script>

function bindClick(id,click)
{
    document.querySelector(id).addEventListener("click",click);
}

var cb1 = function(resp){
    alert(JSON.stringify(resp))
}

bindClick("#btn2",function(){
    // 参数三这里必须用字符串才行
    window.KWJSBridge.invoke_native("getToken", "cb1", "testParams");
});

bindClick("#btn3",function(){
    // 参数三这里必须用字符串才行
    window.KWJSBridge.invoke_native("getUserInfo", "cb1");
});

bindClick("#btn4",function(){
    window.KWJSBridge.invoke_native("goLogin");
});

bindClick("#btn5",function(){
    window.JSKit.hello("goLogin");
});
</script>
</body>
</html>